#pragma once
#include "IBase.h"

class IClickable  : virtual public IBase
{
    friend class GameEngine;
    BOOL m_bHover;

    void DoHover(int x, int y)
    {
        if (!m_bHover)
        {
            m_bHover = TRUE;
            OnHover(x, y);
        }
    }

    void DoLeave()
    {
        if (m_bHover)
        {
            m_bHover = FALSE;
            OnLeave();
        }
    }
public:
    IClickable()
    {
        m_bHover = FALSE;
    }
    virtual void OnClick(int x, int y) = 0;
    virtual void OnHover(int x, int y) = 0;
    virtual void OnLeave() = 0;   
    virtual RECT* GetRect() = 0;
};
